<include file="Common:leftmenu" />
<script src="https://cdn.bootcss.com/layer/2.3/layer.js"></script>
<link href="https://cdn.bootcss.com/layer/2.3/skin/layer.css" rel="stylesheet">
<div class="content-right fl">
    <h1 class="content-right-title">欢迎您！</h1>
    <!-- <div class="alert alert-warning disable-del">注：首页统计数据30分钟更新一次。</div>-->
    <div class="zh_infor_box" data-type="/Shop/getTongJi" id="getTongJi">
        <div class="zh_infor_left">
            <div class="zh_infor_tt">
                <i class="lit_icon mfl"></i>
                <span class="itt"><b>当前账号：</b></span><?php echo $admininfo['username'];?>    </div>
            <div class="zh_infor_cent" style="margin-top:8px;">
                <div class="zh_infor_item">会员总数：<span class="red"><?php echo $data['mall'];?></span></div>
                <div class="zh_infor_item">分销商数：<span class="red"><?php echo $data['m_buy'];?></span></div>

                <div class="zh_infor_item">已支出佣金：<span class="red"><?php echo $data['withdraw_moneyed'];?></span></div>
                <div class="zh_infor_item">待审核提现佣金：<span class="red"><?php echo $data['withdraw_moneyimg'];?></span> </div>
                <div class="clear"></div>
            </div>
        </div>

<div class="zh_infor_right">
    <div class="zh_infor_tt">
        <i class="lit_icon mfr"></i>
        <span class="itt"><b>库存提醒：</b></span><a href="/admin/goods/index">有<span class="red"><?php echo $data['g_count'];?></span>件商品库存少于10件</a>
    </div>
    <div class="zh_infor_cent">
        <div class="zh_infor_item">待发货订单数：<span class="red"><?php echo $data['order_daifahuo'];?></span> 笔</div>
        <div class="zh_infor_item">待退货订单数：<span class="red"><?php echo $data['order_tuihuo'];?></span> 笔</div>
        <div class="zh_infor_item">待付款订单数：<span class="red"><?php echo $data['order_nopay'];?></span> 笔</div>
        <div class="clear"></div>
    </div>
</div>
  
        
<div class="clear"></div>

<div style="margin-bottom:50px;" class="zh_infor_left">
    <div class="zh_infor_tt">
        <span class="itt"></span>  
    </div>
    <div class="zh_infor_cent" style="margin-top:8px;">
        <div class="zh_infor_item">剩余短信数量：<span class="red"><?php echo $leftNum;?></span>条</div>
        <div class="zh_infor_item">已用短信数量：<span class="red"><?php echo $useNum;?></span>条</div>
        <a onclick="buysms()" class="btn btn-danger btn-small">充值短信</a>
        <br>(避免影响贵司业务,请保证剩余短信数量大于0)
        <div class="clear"></div>
    </div>
</div>
        
    </div>

    <table  class="wxtables data mgt15">
        <colgroup>
			<col width="10%">
			<col width="20%">
			<col width="20%">
			<col width="50%">
        </colgroup>
        <thead>
            <tr>
                <td colspan="4" class="left" style="font-size:14px;">数据统计</td>
            </tr>
        </thead>
        <tbody id="tBodyGetTotalCcount">
        
<tr>
    <td>
        <div class="dataItems">今日成交（笔）</div>
        <div class="dataItems">
            <span class="num1"><?php echo $data['order_today_num'];?></span>
        </div>
        <!--  
        <div class="dataItems">环比增幅
            <span class="num2 data-rise">0% <i class="icon-tablesData"></i>
            </span>
        </div>
        -->
        
    </td>
    <td>
        <div class="dataItems">今日消费金额（元）</div>
        <div class="dataItems">
            <span class="num1"><?php echo $data['order_today'];?></span>
        </div>
        <!--  
        <div class="dataItems">环比增幅
            <span class="num2 data-rise">0% <i class="icon-tablesData"></i>
            </span>
        </div>
        -->
    </td>


</tr>




<tr>
    <td>
        <div class="dataItems">昨日成交（笔）</div>
        <div class="dataItems">
            <span class="num1"><?php echo $data['order_yesterday_num'];?></span>
        </div>
        <!--  
        <div class="dataItems">环比增幅
            <span class="num2 data-rise">0% <i class="icon-tablesData"></i>
            </span>
        </div>
        -->
        
    </td>
    <td>
        <div class="dataItems">昨日消费金额（元）</div>
        <div class="dataItems">
            <span class="num1"><?php echo $data['order_yesterday'];?></span>
        </div>
        <!--  
        <div class="dataItems">环比增幅
            <span class="num2 data-rise">0% <i class="icon-tablesData"></i>
            </span>
        </div>
        -->
    </td>
</tr>



<tr>
    <td>
        <div class="dataItems">上周成交（笔）</div>
        <div class="dataItems">
            <span class="num1"><?php echo $data['order_lastweek_num'];?></span>
        </div>
    </td>
    <td>
        <div class="dataItems">上周消费金额（元）</div>
        <div class="dataItems">
            <span class="num1"><?php echo $data['order_lastweek'];?></span>
        </div>
    </td>
</tr>

<tr>
    <td>
        <div class="dataItems">本月成交（笔）</div>
        <div class="dataItems">
            <span class="num1"><?php echo $data['order_month_num'];?></span>
        </div>
        
    </td>
    <td>
        <div class="dataItems">本月消费金额（元）</div>
        <div class="dataItems">
            <span class="num1"><?php echo $data['order_month'];?></span>
        </div>
    </td>
</tr>

<tr>
    <td>
        <div class="dataItems">上月成交（笔）</div>
        <div class="dataItems">
            <span class="num1"><?php echo $data['order_lastmonth_num'];?></span>
        </div>
        
    </td>
    <td>
        <div class="dataItems">上月消费金额（元）</div>
        <div class="dataItems">
            <span class="num1"><?php echo $data['order_lastmonth'];?></span>
        </div>
    </td>

</tr>


<tr>
    <td>
        <div class="dataItems">总成交（笔）</div>
        <div class="dataItems">
            <span class="num1"><?php echo $data['order_all_num'];?></span>
        </div>
    </td>
    <td>
        <div class="dataItems">总消费金额（元）</div>
        <div class="dataItems">
            <span class="num1"><?php echo $data['order_all'];?></span>
        </div>
    </td>
</tr>
</tbody>
    </table>
</div>
<script type="text/x-template" id="layerhtml" >
    充值金额 <input class="layer-input" id="mymoney" type="number" />元<br>
    <div id="mynotice" style="margin-left:4.2em;"></div>
    <p style="margin-top:20px;font-size: 15px;">
        单次充值500元以下,0.06元/条<br>
        单次充值500元以上,0.05元/条<br>
    </p>
</script>
<script>
<?php if($leftNum<1000) { ?>
    layer.open({
        title: '提醒',
        content: '可用短信已低于1000条,为避免您的业务受影响,请及时充值'
    }); 
<?php } ?>
function buysms () {
    layer.open({
        title:'短信充值',
        content: $('#layerhtml').html(),
        btn: ['确定', '取消'],
        yes: function(index, layero){
            var money = $('#mymoney').val();
            money = parseInt(money);
            if(money<1) {
                layer.msg('充值一元起');
                return false;
            }
            if(money>=0) {
                location.href="/mobile/services/sms?money="+money;
            }else{
                layer.msg('请正确输入金额');
            }
        },
        btn2: function(index, layero){
        },
        cancel: function(){ 
    }
    });
}


$('body').on('keyup','#mymoney',function(){
    var money = $('#mymoney').val();
    money = parseInt(money);
    
    if(money>0) {
        if(money>=500) {
            var num = money/0.05;
        }else{
            var num = money/0.06;
        }
        num = parseInt(num);
        $('#mynotice').text(num+'条');
    }else{
        $('#mynotice').text('');
    }
    
})
</script>
<style>
.layer-input {
    display: inline-block;
    width: 200px;
    height: 36px;
    margin: 0 auto;
    line-height: 30px;
    padding-left: 10px;
    border: 1px solid #e6e6e6;
    color: #333;
}
</style>